package com.hotel.controller;

import com.hotel.response.Result;
import com.hotel.service.EchartsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@Api(tags = "echarts图表接口")
@RestController
@RequestMapping(value = "echarts")
public class EchartsController {

    @Resource
    private EchartsService echartsService;


    @ApiOperation(value = "获取当月各类房销售总额")
    @GetMapping("/getMonthList")
    public Result getMonthList(){
        Map<String, Object> monthList = echartsService.getMonthList();
        return Result.ok().data("monthList",monthList);
    }

    @ApiOperation(value = "获取当日各类房销售总额")
    @GetMapping("/getDayList")
    public Result getDayList(){
        Map<String, Object> dayList = echartsService.getDayList();
        return Result.ok().data("dayList",dayList);
    }

    @ApiOperation(value = "获取当前星期每天各类房销售总额")
    @GetMapping("/getWeekList")
    public Result getWeekList(){
        Map<String, Map<String, Object>> weeKList = echartsService.getWeeKList();
        return Result.ok().data("weekList",weeKList);
    }


}
